/**
 * Created by haoran.shu on 2018/11/12 14:46.
 */
const supertest = require('supertest');
const req = supertest(require('../baseurl'));

describe('router_index', function () {

  describe('code', function () {

    it('get_code', function (done) {
      req.get('/code').query({tel: 15828568760}).expect(200, done);
    });

  });

  describe('regist', function () {

    it('regist', function (done) {
      req.post('/regist').send('tel=15828568760&password=123456&code=7932').expect(200, done);
    });

  });

  describe('reset', function () {

    it('lack_tel', function (done) {
      req.post('/reset').send('password=123456').expect(200, done);
    });

    it('lack_password', function (done) {
      req.post('/reset').send('tel=15828568760').expect(200, done);
    });

    it('tel_error', function (done) {
      req.post('/reset').send('tel=15242304387&password=123456').expect(200, done);
    });

    it('success', function (done) {
      req.post('/reset').send('tel=15828568760&password=123456').expect(200, done);
    });

  });

});
